#pragma once
#ifndef __ATTEST__H__
#define __ATTEST__H__

#include "Testable.h"
#include "Test.h"
#include "TestCase.h"
#include "TestSuite.h"
#include "TestFactory.h"
#include "Log.h"
#include "Writer.h"
#include "DebugFactory.h"

namespace AllTing
{

namespace Test
{

#ifndef WIN32
#define __TEXT(x) L##x
#define TEXT(x) __TEXT(x)
#endif

// How to use __FILE__ to unicode
// http://www.microsoft.com/msj/1197/win321197.aspx
#define ATASSERT(expr) \
	DebugFactory::Instance()->Assert(expr, TEXT(__FILE__), __LINE__);

#define ATTRACE \
	DebugFactory::Instance()->Log

#define NEW_TEST(testee) \
	TestFactory::Instance()->Create(this, static_cast<TestCase::Testee>(&testee), TEXT(#testee))

#define NEW_FUNC(func) \
	TestFactory::Instance()->Create(static_cast< ::Func>(&func), TEXT(#func))

#define REPORT_TEST() \
	DebugFactory::Instance()->Report()

#define DESTROY_TEST() \
	TestFactory::Instance()->Destroy()

}	//namespace Test

}	//namespace AllTing

#endif